package com.yunji.generate.fxml;

import javafx.scene.Node;
import javafx.stage.Stage;

import java.util.EventObject;

/**
 * @author Kevin
 * @since 2019/09/23.
 */
public class BaseController {

    protected static Stage stage(EventObject event) {
        return (Stage) (((Node) event.getSource()).getScene().getWindow());
    }

    protected static void hide(EventObject event) {
        stage(event).hide();
    }

    protected static void showStage(EventObject event) {
        stage(event).show();
    }
}
